const serviceSql=require('../service/service')

class registerController{
    async register(ctx,next){
        const {name,password}=ctx.request.body
        let {affectedRows}=await serviceSql.register(name,password)
        if(affectedRows){
            ctx.mesg='注册成功'
            ctx.body=[]
        }
        await next()
    }
}


module.exports=new registerController()